import 'dart:ffi';

import 'lf_product_plugin_platform_interface.dart';

class LfProductPlugin {
  void onListening(void Function(dynamic event) onData) {
    return LfProductPluginPlatform.instance.onListening(onData);
  }

  Future<String?> getPlatformVersion() {
    return LfProductPluginPlatform.instance.getPlatformVersion();
  }

  Future<String?> getHelloWorld() {
    return LfProductPluginPlatform.instance.getHelloWorld();
  }

  Future<dynamic> calculate4({
    required double height,
    required double weight,
    required double heartRate,
    required double impendance,
    required int age,
    required int gender, // 1=男, 0=女
  }) {
    return LfProductPluginPlatform.instance.calculate4(
      height: height,
      weight: weight,
      heartRate: heartRate,
      impendance: impendance,
      age: age,
      gender: gender,
    );
  }

  Future<dynamic> calculate8({
    required double height,
    required double weight,
    required double heartRate,
    required int age,
    required int gender, // 1=男, 0=女
    required int z20KhzLeftArmEnCode,
    required int z20KhzRightArmEnCode,
    required int z20KhzLeftLegEnCode,
    required int z20KhzRightLegEnCode,
    required int z20KhzTrunkEnCode,
    required int z100KhzLeftArmEnCode,
    required int z100KhzRightArmEnCode,
    required int z100KhzLeftLegEnCode,
    required int z100KhzRightLegEnCode,
    required int z100KhzTrunkEnCode,
  }) {
    return LfProductPluginPlatform.instance.calculate8(
      height: height,
      weight: weight,
      heartRate: heartRate,
      age: age,
      gender: gender,
      z20KhzLeftArmEnCode: z20KhzLeftArmEnCode,
      z20KhzRightArmEnCode: z20KhzRightArmEnCode,
      z20KhzLeftLegEnCode: z20KhzLeftLegEnCode,
      z20KhzRightLegEnCode: z20KhzRightLegEnCode,
      z20KhzTrunkEnCode: z20KhzTrunkEnCode,
      z100KhzLeftArmEnCode: z100KhzLeftArmEnCode,
      z100KhzRightArmEnCode: z100KhzRightArmEnCode,
      z100KhzLeftLegEnCode: z100KhzLeftLegEnCode,
      z100KhzRightLegEnCode: z100KhzRightLegEnCode,
      z100KhzTrunkEnCode: z100KhzTrunkEnCode,
    );
  }

  Future<String?> scan() {
    return LfProductPluginPlatform.instance.scan();
  }

  Future<String?> link({
    required dynamic device,
  }) {
    return LfProductPluginPlatform.instance.link(
      device: device,
    );
  }
}
